<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\DiplomaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Diplomas';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="diploma-index">

    <?php Pjax::begin(); ?>
    <div class="panel">
		<div class="panel-heading panel-heading-auto">
            <?php echo $this->render('_search', ['model' => $searchModel]); ?>
		</div>
        <div class="panel-body">

    <p>
        <?= Html::a('批量打印', ['print-batch'], ['class' => 'btn btn-cyan']) ?>
    </p>
    
    <?= GridView::widget([
        'layout' => "{items}\n{pager}",
        'tableOptions' => ['class' => 'table table-hover table-bordered'],
        'dataProvider' => $dataProvider,
        //'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\CheckboxColumn'],
            ['class' => 'yii\grid\SerialColumn', 'header' => '序号'],

            //'ID',
            [
                'attribute' => 'GRID',
                'label' => '学生姓名',
                'value' => function($model){return $model->gR->name;}
            ],
            [
                'attribute' => 'GRID',
                'label' => '性别',
                'value' => function($model){return $model->gR->sex;}
            ],
            [
                'attribute' => 'GRID',
                'label' => '身份证号',
                'value' => function($model){return $model->gR->id_number;}
            ],
            'BYZBH',
            'BYND',
            [
                'attribute' => 'XXID',
                'label' => '毕业学校',
                'value' => function($model){return $model->xX->ZWMC;}
            ],
            [
                'attribute' => 'XXID',
                'label' => '毕业专业',
                'value' => function($model){return $model->bJ->zY->ZYMC;}
            ],
            'FZRQ:date',
            //'BYZ',
            //'BJID',
            //'XH',
            //'XSXM',
            //'XB',
            //'SFZHM',
            //'RXSJ',
            //'LXSJ',
            //'BXXF',
            //'XXXF',
            'ZT',

            ['class' => 'yii\grid\ActionColumn', 'header'=>'操作', 'template'=>'{view}'],
        ],
    ]); ?>

		</div>
	</div>
    <?php Pjax::end(); ?>

</div>
